<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/frame/layui/css/layui.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/frame/static/css/style.css">
<link rel="icon"
	href="${pageContext.request.contextPath }/frame/static/image/code.png">
<script type="text/javascript"
	src="${pageContext.request.contextPath }/frame/layui/layui.js"></script>
</head>

<body class="login-body body">
	<div class="login-box">
		<form id="loginForm" class="layui-form layui-form-pane" method="post"
			action="${pageContext.request.contextPath }/userAction_login.action">
			<div class="layui-form-item">
				<h3>江岸日用化工登录系统</h3>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">账号：</label>

				<div class="layui-input-inline">
					<input type="text" name="username" class="layui-input"
						lay-verify="account" placeholder="账号" autocomplete="on"
						maxlength="20" />
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">密码：</label>

				<div class="layui-input-inline">
					<input type="password" name="password" class="layui-input"
						lay-verify="password" placeholder="密码" maxlength="20" />
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">验证码：</label>
				<div class="layui-input-inline">
					<input class="layui-input" name="checkcode" placeholder="验证码"
						lay-verify="required" type="text" autocomplete="off"
						style="width: 90px"> <img id="loginform:vCode"
						style="margin-left: 100px; margin-top: -37px"
						src="${pageContext.request.contextPath }/validatecode.jsp"
						onclick="javascript:document.getElementById('loginform:vCode').src='${pageContext.request.contextPath }/validatecode.jsp?'+Math.random();" />
				</div>
			</div>
			<div class="layui-form-item">
				<button type="reset" class="layui-btn layui-btn-danger btn-reset">重置</button>
				<button id="btn-login" type="submit" class="layui-btn btn-submit"
					lay-submit="" lay-filter="sub">立即登录</button>
			</div>
			<center>
				<s:actionerror style="color:red" />
			</center>
		</form>
	</div>

	<script type="text/javascript">
		layui.use([ 'form', 'layer' ], function() {
			// 操作对象
			var form = layui.form, layer = layui.layer, $ = layui.jquery;

			// 验证
			form.verify({
				account : function(value) {
					if (value == "") {
						return "请输入用户名";
					}
				},
				password : function(value) {
					if (value == "") {
						return "请输入密码";
					}
				},
				code : function(value) {
					if (value == "") {
						return "请输入验证码";
					}
				}
			});

			// 提交监听
			form.on('submit(sub)', function(data) {

				return true;
			});
		})
	</script>
</body>
</html>